package boardgamer.spammer;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Ordering;

import java.util.List;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * List all apps in this enum. The first app listed is the oldest app and will be displayed last.
 *
 * @author garysoed
 */
enum AdsType {

  EYES_BREAKER(R.drawable.eyebre_logo, R.string.eyebre_promo, R.string.eyebre_package),
  TEST1(0, 0, 0), // For testing only, DO NOT USE
  TEST2(1, 2, 3); // For testing only, DO NOT USE

  private final int logoRef;
  private final int stringRef;
  private final int packageNameRef;

  private AdsType(int logoRef, int stringRef, int packageNameRef) {
    this.logoRef = checkNotNull(logoRef, "logoRef");
    this.stringRef = checkNotNull(stringRef, "stringRef");
    this.packageNameRef = checkNotNull(packageNameRef, "packageNameRef");
  }

  public static final List<AdsType> ALL_ADS
      = Ordering.natural().sortedCopy(ImmutableSet.copyOf(AdsType.values()));

  public int getLogoRef() {
    return logoRef;
  }

  public int getStringRef() {
    return stringRef;
  }

  public int getPackageNameRef() {
    return packageNameRef;
  }
}
